home *** CD-ROM | disk | FTP | other *** search
/ MacWarehouse Macintosh Games / MacWarehouse Macintosh Games.iso / AMBER demo / ROXY / ROXY.dxr / 00018_more custom Roxy handlerss.ls < prev    next >
Encoding:
Text File  |  1996-10-18  |  18.5 KB  |  538 lines

  1. on peekAlert
  2.   global oStoryteller, oPuppeteer, gPeekAlertEnabled
  3.   if (gPeekAlertEnabled = 0) or (getState(oStoryteller, #playerHasPeekUnit) = 0) then
  4.     exit
  5.   end if
  6.   set colorGraphic to getAt(getProp(the lsInventoryData of oPuppeteer, #PeekUnit), 1)
  7.   set highGlowGraphic to getAt(getProp(the lsInventoryData of oPuppeteer, #PeekUnit), 3)
  8.   set lowGlowGraphic to getAt(getProp(the lsInventoryData of oPuppeteer, #PeekUnit), 2)
  9.   set oldPeekGraphic to the castNum of sprite 7
  10.   if oldPeekGraphic = colorGraphic then
  11.     set lowGlowGraphic to colorGraphic
  12.   end if
  13.   set bigGlow to 1
  14.   repeat with i = 1 to 12
  15.     set startTix to the ticks
  16.     repeat while the ticks < (startTix + 5)
  17.       updateStage()
  18.     end repeat
  19.     if bigGlow = 1 then
  20.       set the castNum of sprite 7 to highGlowGraphic
  21.     else
  22.       set the castNum of sprite 7 to lowGlowGraphic
  23.     end if
  24.     updateStage()
  25.     set bigGlow to not bigGlow
  26.   end repeat
  27.   set the castNum of sprite 7 to oldPeekGraphic
  28.   updateStage()
  29. end
  30.  
  31. on setScanTime howManyMinutes
  32.   global gScanFinish
  33.   set gScanFinish to the ticks + (howManyMinutes * 3600)
  34.   setState(oStoryteller, #PeekDisplay, value("#goodScan" & howManyMinutes & "min"))
  35.   setState(oStoryteller, #PKscanStatus, value("#Wait" & howManyMinutes & "min"))
  36.   peekAlert()
  37. end
  38.  
  39. on approachOfficeLaptop
  40.   global oStoryteller, oPuppeteer, gPsionFrames, gPsionSpins, gVoid
  41.   set currentScreen to getState(oStoryteller, #BT_fragStatus)
  42.   if currentScreen = #none then
  43.     goTo(#OfficeMonitorCU, #lookAt)
  44.   else
  45.     setState(oStoryteller, #showMontage, 2)
  46.     if currentScreen = #crisisPrompt then
  47.       goTo(#OfficeMonitor_PTsuite, #lookAt)
  48.       loadMultiFrames(#BT_continueBtn)
  49.       loadMultiFrames(#BT_checkBox)
  50.       loadMultiFrames(#BT_align_left)
  51.       loadMultiFrames(#BT_align_right)
  52.       loadMultiFrames(#BT_bias1)
  53.       loadMultiFrames(#BT_bias2)
  54.       loadMultiFrames(#BT_bias3)
  55.       loadMultiFrames(#BT_psionFrames)
  56.     end if
  57.     if (currentScreen = #alignment) or (currentScreen = #spinningNow) then
  58.       goTo(#OfficeMonitor_alignment, #lookAt)
  59.       loadMultiFrames(#BT_checkBox)
  60.       loadMultiFrames(#BT_align_left)
  61.       loadMultiFrames(#BT_align_right)
  62.       loadMultiFrames(#BT_bias1)
  63.       loadMultiFrames(#BT_bias2)
  64.       loadMultiFrames(#BT_bias3)
  65.       loadMultiFrames(#BT_psionFrames)
  66.       if gPsionSpins = [0, 0, 0] then
  67.         set gPsionFrames to gVoid
  68.       end if
  69.       setState(oStoryteller, #BT_fragStatus, #spinningNow)
  70.     end if
  71.     if (currentScreen = #algoPrompt) or (currentScreen = #algorithm) then
  72.       loadMultiFrames(#BT_algoLeft)
  73.       loadMultiFrames(#BT_algoMiddle)
  74.       loadMultiFrames(#BT_algoRight)
  75.       loadMultiFrames(#BT_algo_topBtn)
  76.       loadMultiFrames(#BT_algo_bottomBtn)
  77.       loadMultiFrames(#BT_continueBtn)
  78.       goTo(#OfficeMonitor_algorithm, #fadeIn)
  79.     end if
  80.     if currentScreen = #allDone then
  81.       goTo(#OfficeMonitor_algorithm, #fadeIn)
  82.     end if
  83.   end if
  84. end
  85.  
  86. on backAwayFromLaptop
  87.   global oStoryteller, oPuppeteer, gPsionFrames
  88.   set currentScreen to getState(oStoryteller, #BT_fragStatus)
  89.   if currentScreen = #none then
  90.     put "<!> backAwayFromLaptop(): #BT_fragStatus = #None.. we shouldn't be here!"
  91.   else
  92.     cursorOff()
  93.     if currentScreen = #spinningNow then
  94.       setState(oStoryteller, #BT_fragStatus, #alignment)
  95.     end if
  96.     if getState(oStoryteller, #showMontage) <> 2 then
  97.       setState(oStoryteller, #showMontage, 3)
  98.       updateDisplay(oPuppeteer)
  99.       set resumeTime to the ticks + 60
  100.     else
  101.       set resumeTime to the ticks
  102.     end if
  103.     purgeMultiframes(#BT_checkBox)
  104.     purgeMultiframes(#BT_align_left)
  105.     purgeMultiframes(#BT_align_right)
  106.     purgeMultiframes(#BT_bias1)
  107.     purgeMultiframes(#BT_bias2)
  108.     purgeMultiframes(#BT_bias3)
  109.     purgeMultiframes(#BT_psionFrames)
  110.     repeat while the ticks < resumeTime
  111.       updateStage()
  112.     end repeat
  113.     setState(oStoryteller, #showMontage, 2)
  114.     updateDisplay(oPuppeteer)
  115.   end if
  116. end
  117.  
  118. on OLDinitAlignmentPuzzle options
  119.   global oStoryteller, oPuppeteer, gPsionFrames
  120.   set psion1_sprite to 16
  121.   set psion2_sprite to 17
  122.   set psion3_sprite to 18
  123.   set psionFrameStack to getProp(the lsMultiFrames of oPuppeteer, #BT_psionFrames)
  124.   set gPsionFrames to [1, 1, 1]
  125.   set psionSpins to [2, 0, -2]
  126.   set alignmentModifiers to [1, 0, -1]
  127.   set biasModifiers to [1, 0, -1]
  128.   set netSpins to [4, 2, -1]
  129.   set timeSlice to 0
  130.   repeat while not (the mouseDown)
  131.     idle()
  132.     wait(2)
  133.     set timeSlice to timeSlice + 1
  134.     set psionNumber to 1
  135.     repeat with whichSprite = psion1_sprite to psion3_sprite
  136.       if (timeSlice mod (4 - getAt(netSpins, psionNumber))) = 0 then
  137.         set newFrame to (getAt(gPsionFrames, psionNumber) mod 5) + 1
  138.         set the castNum of sprite whichSprite to getAt(psionFrameStack, newFrame)
  139.         setAt(gPsionFrames, psionNumber, newFrame)
  140.       end if
  141.       set psionNumber to psionNumber + 1
  142.     end repeat
  143.     updateStage()
  144.   end repeat
  145.   mouseDown()
  146. end
  147.  
  148. on refreshAlignmentPuzzle options
  149.   global oStoryteller, oPuppeteer, gPsionFrames, gPsionSpins
  150.   set psion1_sprite to 16
  151.   set psion2_sprite to 17
  152.   set psion3_sprite to 18
  153.   set psionFrameStack to getProp(the lsMultiFrames of oPuppeteer, #BT_psionFrames)
  154.   if voidp(gPsionFrames) then
  155.     set gPsionFrames to [1, 3, 4]
  156.     updatePsionSpins()
  157.   end if
  158.   set psionNumber to 1
  159.   repeat with whichSprite = psion1_sprite to psion3_sprite
  160.     set mySpin to getAt(gPsionSpins, psionNumber)
  161.     if mySpin = 0 then
  162.       set psionNumber to psionNumber + 1
  163.       next repeat
  164.     end if
  165.     set oldFrame to getAt(gPsionFrames, psionNumber)
  166.     set newFrame to ((oldFrame + mySpin + 23) mod 24) + 1
  167.     set the castNum of sprite whichSprite to getAt(psionFrameStack, newFrame)
  168.     setAt(gPsionFrames, psionNumber, newFrame)
  169.     set psionNumber to psionNumber + 1
  170.   end repeat
  171.   updateStage()
  172. end
  173.  
  174. on updatePsionSpins
  175.   global oStoryteller, oPuppeteer, gPsionSpins, gPsionFrames, gOriginPoint, oMemory
  176.   if not listp(gPsionSpins) then
  177.     set gPsionSpins to [1, 1, 1]
  178.   end if
  179.   set inherentSpins to [2, -2, 0]
  180.   set alignmentModifiers to [1, 0, -1]
  181.   set biasModifiers to [0, 0, 0]
  182.   if getState(oStoryteller, #BT_bias) = 1 then
  183.     set biasModifiers to [1, 0, -1]
  184.   end if
  185.   if getState(oStoryteller, #BT_bias) = 2 then
  186.     set biasModifiers to [0, -1, 1]
  187.   end if
  188.   if getState(oStoryteller, #BT_bias) = 3 then
  189.     set biasModifiers to [-1, 1, 0]
  190.   end if
  191.   set psionOrder to getProp(the lsStateData of oStoryteller, #BT_psionOrder)
  192.   set speedCodes to [-6, -4, -2, -1, 0, 1, 2, 4, 6]
  193.   set whichPosition to 1
  194.   repeat with psionNumber in psionOrder
  195.     set alignAdjust to getAt(alignmentModifiers, whichPosition)
  196.     set biasAdjust to getAt(biasModifiers, whichPosition)
  197.     set myInherentSpin to getAt(inherentSpins, psionNumber)
  198.     set newSpeed to myInherentSpin + alignAdjust + biasAdjust
  199.     set frameGap to getAt(speedCodes, newSpeed + 5)
  200.     setAt(gPsionSpins, whichPosition, frameGap)
  201.     set whichPosition to whichPosition + 1
  202.   end repeat
  203.   if gPsionSpins = [0, 0, 0] then
  204.     set gPsionSpins to [2, 2, 2]
  205.     set lastSpin to the ticks
  206.     repeat while (gPsionFrames <> [1, 1, 1]) and not (the optionDown)
  207.       repeat while lastSpin > (the ticks - 4)
  208.         updateStage()
  209.       end repeat
  210.       set lastSpin to the ticks
  211.       refreshAlignmentPuzzle()
  212.       repeat with testPsion = 1 to 3
  213.         set currentFrame to getAt(gPsionFrames, testPsion)
  214.         if currentFrame < 12 then
  215.           setAt(gPsionSpins, testPsion, -2)
  216.         end if
  217.         if currentFrame < 6 then
  218.           setAt(gPsionSpins, testPsion, -1)
  219.         end if
  220.         if currentFrame > 12 then
  221.           setAt(gPsionSpins, testPsion, 2)
  222.         end if
  223.         if currentFrame > 18 then
  224.           setAt(gPsionSpins, testPsion, 1)
  225.         end if
  226.         if currentFrame = 1 then
  227.           setAt(gPsionSpins, testPsion, 0)
  228.         end if
  229.       end repeat
  230.     end repeat
  231.     set gPsionSpins to [0, 0, 0]
  232.     soundEffect(#happyBeep)
  233.     wait(10)
  234.     purgeMultiframes(#BT_align_left)
  235.     purgeMultiframes(#BT_align_right)
  236.     purgeMultiframes(#BT_bias1)
  237.     purgeMultiframes(#BT_bias2)
  238.     purgeMultiframes(#BT_bias3)
  239.     purgeMultiframes(#BT_psionFrames)
  240.     if objectp(oMemory) then
  241.       oMemory(mCompact)
  242.     end if
  243.     set the castNum of sprite 44 to 7
  244.     updateStage()
  245.     set the castNum of sprite 44 to 2381
  246.     setState(oStoryteller, #BT_fragStatus, #algoPrompt)
  247.     set the visible of sprite 44 to 0
  248.     set the loc of sprite 44 to point(258, 221) + gOriginPoint
  249.     set the visible of sprite 44 to 1
  250.     updateStage()
  251.     pushVideo()
  252.     wait(#videoStop)
  253.     set the castNum of sprite 44 to the number of cast getProp(the lsForegroundData of oPuppeteer, #algo_prompt)
  254.     set the visible of sprite 44 to 0
  255.     set the loc of sprite 44 to point(321, 212) + gOriginPoint
  256.     set the visible of sprite 44 to 1
  257.     updateStage()
  258.     pushVideo()
  259.     wait(#videoStop)
  260.     goTo(#OfficeMonitor_algorithm)
  261.   end if
  262. end
  263.  
  264. on setFragmentAlignment option
  265.   global oStoryteller, oPuppeteer
  266.   set checkFrames to getProp(the lsMultiFrames of oPuppeteer, #BT_checkBox)
  267.   set leftFrames to getProp(the lsMultiFrames of oPuppeteer, #BT_align_left)
  268.   set rightFrames to getProp(the lsMultiFrames of oPuppeteer, #BT_align_right)
  269.   set currentPsionOrder to getProp(the lsStateData of oStoryteller, #BT_psionOrder)
  270.   set currentState to getState(oStoryteller, #BT_alignmentLeft)
  271.   if currentState <> #off then
  272.     set currentState to #on
  273.   end if
  274.   set checkSprite to 19
  275.   set leftAlignSprite to 20
  276.   set rightAlignSprite to 21
  277.   if option = #toggle then
  278.     if currentState = #on then
  279.       setProp(the lsStateData of oStoryteller, #BT_alignmentLeft, [#off])
  280.       setProp(the lsStateData of oStoryteller, #BT_alignmentRight, [#off])
  281.       set the castNum of sprite checkSprite to getProp(checkFrames, #off)
  282.       set the castNum of sprite leftAlignSprite to getProp(leftFrames, #off)
  283.       set the castNum of sprite rightAlignSprite to getProp(rightFrames, #off)
  284.       updateStage()
  285.     else
  286.       setProp(the lsStateData of oStoryteller, #BT_alignmentLeft, [#on])
  287.       setProp(the lsStateData of oStoryteller, #BT_alignmentRight, [#on])
  288.       set the castNum of sprite checkSprite to getProp(checkFrames, #on)
  289.       set the castNum of sprite leftAlignSprite to getProp(leftFrames, #on)
  290.       set the castNum of sprite rightAlignSprite to getProp(rightFrames, #on)
  291.       updateStage()
  292.     end if
  293.   end if
  294.   if currentState = #on then
  295.     if option = #clockWise then
  296.       set newFirst to getAt(currentPsionOrder, 3)
  297.       deleteAt(currentPsionOrder, 3)
  298.       addAt(currentPsionOrder, 1, newFirst)
  299.       migrateParticles(#clockWise)
  300.       refreshAlignmentPuzzle()
  301.       updatePsionSpins()
  302.     end if
  303.     if option = #counter then
  304.       set newLast to getAt(currentPsionOrder, 1)
  305.       deleteAt(currentPsionOrder, 1)
  306.       addAt(currentPsionOrder, 3, newLast)
  307.       migrateParticles(#counter)
  308.       refreshAlignmentPuzzle()
  309.       updatePsionSpins()
  310.     end if
  311.   end if
  312. end
  313.  
  314. on setFragmentBias option
  315.   global oStoryteller, oPuppeteer
  316.   set checkFrames to getProp(the lsMultiFrames of oPuppeteer, #BT_checkBox)
  317.   set bias1Frames to getProp(the lsMultiFrames of oPuppeteer, #BT_bias1)
  318.   set bias2Frames to getProp(the lsMultiFrames of oPuppeteer, #BT_bias2)
  319.   set bias3Frames to getProp(the lsMultiFrames of oPuppeteer, #BT_bias3)
  320.   set currentState to getState(oStoryteller, #BT_bias)
  321.   set checkSprite to 22
  322.   set bias1Sprite to 23
  323.   set bias2Sprite to 24
  324.   set bias3Sprite to 25
  325.   if option = #toggle then
  326.     if currentState = #off then
  327.       set newState to getState(oStoryteller, #BT_storedBias)
  328.       setState(oStoryteller, #BT_bias, newState)
  329.       set the castNum of sprite checkSprite to getProp(checkFrames, #on)
  330.       set the castNum of sprite bias1Sprite to getProp(bias1Frames, newState)
  331.       set the castNum of sprite bias2Sprite to getProp(bias2Frames, newState)
  332.       set the castNum of sprite bias3Sprite to getProp(bias3Frames, newState)
  333.       updateStage()
  334.     else
  335.       setState(oStoryteller, #BT_bias, #off)
  336.       set the castNum of sprite checkSprite to getProp(checkFrames, #off)
  337.       set the castNum of sprite bias1Sprite to getProp(bias1Frames, #off)
  338.       set the castNum of sprite bias2Sprite to getProp(bias2Frames, #off)
  339.       set the castNum of sprite bias3Sprite to getProp(bias3Frames, #off)
  340.       updateStage()
  341.     end if
  342.   end if
  343.   if currentState <> #off then
  344.     if getPos([1, 2, 3, #none], option) <> 0 then
  345.       setState(oStoryteller, #BT_bias, option)
  346.       setState(oStoryteller, #BT_storedBias, option)
  347.       set the castNum of sprite bias1Sprite to getProp(bias1Frames, option)
  348.       set the castNum of sprite bias2Sprite to getProp(bias2Frames, option)
  349.       set the castNum of sprite bias3Sprite to getProp(bias3Frames, option)
  350.     end if
  351.   end if
  352.   updatePsionSpins()
  353. end
  354.  
  355. on migrateParticles direction
  356.   global oStoryteller, oPuppeteer, gPsionFrames
  357.   set oldFP to the floatPrecision
  358.   set the floatPrecision to 1
  359.   set psion1_sprite to 16
  360.   set psion2_sprite to 17
  361.   set psion3_sprite to 18
  362.   set numberOfSteps to 30
  363.   set swellPixels to 4
  364.   set start1 to the loc of sprite psion1_sprite * 1
  365.   set start2 to the loc of sprite psion2_sprite
  366.   set start3 to the loc of sprite psion3_sprite
  367.   if direction = #clockWise then
  368.     set dest1 to start2
  369.     set dest2 to start3
  370.     set dest3 to start1
  371.   else
  372.     set dest1 to start3
  373.     set dest2 to start1
  374.     set dest3 to start2
  375.   end if
  376.   set distanceFactor to 1.0 / numberOfSteps
  377.   set delta1 to dest1 - start1
  378.   set delta2 to dest2 - start2
  379.   set delta3 to dest3 - start3
  380.   repeat with step = 1 to numberOfSteps
  381.     set newMultiplier to step * distanceFactor
  382.     set swellMultiplier to 1 - abs(1 - (newMultiplier * 2))
  383.     set swellVector to integer(swellPixels * swellMultiplier)
  384.     set offset1 to delta1 * newMultiplier
  385.     set newLoc to start1 + offset1
  386.     if direction = #clockWise then
  387.       set Xint to integer(getAt(newLoc, 1))
  388.       set Yint to integer(getAt(newLoc, 2)) - swellVector
  389.     else
  390.       set Xint to integer(getAt(newLoc, 1)) - swellVector
  391.       set Yint to integer(getAt(newLoc, 2))
  392.     end if
  393.     set intLoc to point(Xint, Yint)
  394.     set the loc of sprite psion1_sprite to intLoc
  395.     set offset2 to delta2 * newMultiplier
  396.     set newLoc to start2 + offset2
  397.     if direction = #clockWise then
  398.       set Xint to integer(getAt(newLoc, 1)) + swellVector
  399.       set Yint to integer(getAt(newLoc, 2))
  400.     else
  401.       set Xint to integer(getAt(newLoc, 1))
  402.       set Yint to integer(getAt(newLoc, 2)) - swellVector
  403.     end if
  404.     set intLoc to point(Xint, Yint)
  405.     set the loc of sprite psion2_sprite to intLoc
  406.     set offset3 to delta3 * newMultiplier
  407.     set newLoc to start3 + offset3
  408.     if direction = #clockWise then
  409.       set Xint to integer(getAt(newLoc, 1)) - swellVector
  410.       set Yint to integer(getAt(newLoc, 2))
  411.     else
  412.       set Xint to integer(getAt(newLoc, 1)) + swellVector
  413.       set Yint to integer(getAt(newLoc, 2))
  414.     end if
  415.     set intLoc to point(Xint, Yint)
  416.     set the loc of sprite psion3_sprite to intLoc
  417.     refreshAlignmentPuzzle()
  418.   end repeat
  419.   if direction = #clockWise then
  420.     set temp to getAt(gPsionFrames, 3)
  421.     deleteAt(gPsionFrames, 3)
  422.     addAt(gPsionFrames, 1, temp)
  423.   else
  424.     set temp to getAt(gPsionFrames, 1)
  425.     deleteAt(gPsionFrames, 1)
  426.     addAt(gPsionFrames, 3, temp)
  427.   end if
  428.   set the loc of sprite psion1_sprite to start1
  429.   set the loc of sprite psion2_sprite to start2
  430.   set the loc of sprite psion3_sprite to start3
  431.   set the floatPrecision to oldFP
  432. end
  433.  
  434. on adjustAlgorithm whichColumn, upOrDown
  435.   global oStoryteller, oPuppeteer, gOriginPoint, oMemory
  436.   cursorOff()
  437.   if whichColumn = #left then
  438.     set columnStack to getProp(the lsMultiFrames of oPuppeteer, #BT_algoLeft)
  439.   end if
  440.   if whichColumn = #middle then
  441.     set columnStack to getProp(the lsMultiFrames of oPuppeteer, #BT_algoMiddle)
  442.   end if
  443.   if whichColumn = #right then
  444.     set columnStack to getProp(the lsMultiFrames of oPuppeteer, #BT_algoRight)
  445.   end if
  446.   set columnSprite to 0
  447.   repeat with i = 10 to 48
  448.     if getPos(columnStack, the castNum of sprite i) then
  449.       set columnSprite to i
  450.       exit repeat
  451.     end if
  452.   end repeat
  453.   startTimer()
  454.   set lagTime to 0
  455.   repeat while the stillDown or (the timer < 2)
  456.     if the timer > lagTime then
  457.       if whichColumn = #left then
  458.         set currentSetting to getState(oStoryteller, #BT_algorithmLeft)
  459.         if upOrDown = #up then
  460.           set newSetting to currentSetting - 1
  461.         end if
  462.         if upOrDown = #down then
  463.           set newSetting to currentSetting + 1
  464.         end if
  465.       end if
  466.       if whichColumn = #middle then
  467.         set currentSetting to getState(oStoryteller, #BT_algorithmMiddle)
  468.         if upOrDown = #up then
  469.           set newSetting to currentSetting - 1
  470.         end if
  471.         if upOrDown = #down then
  472.           set newSetting to currentSetting + 1
  473.         end if
  474.       end if
  475.       if whichColumn = #right then
  476.         set currentSetting to getState(oStoryteller, #BT_algorithmRight)
  477.         if upOrDown = #up then
  478.           set newSetting to currentSetting - 1
  479.         end if
  480.         if upOrDown = #down then
  481.           set newSetting to currentSetting + 1
  482.         end if
  483.       end if
  484.       if (newSetting < 1) or (newSetting > 8) then
  485.         soundEffect(#algorithmNotAvail)
  486.         exit repeat
  487.       else
  488.         if whichColumn = #left then
  489.           setProp(the lsStateData of oStoryteller, #BT_algorithmLeft, list(newSetting))
  490.         end if
  491.         if whichColumn = #middle then
  492.           setProp(the lsStateData of oStoryteller, #BT_algorithmMiddle, list(newSetting))
  493.         end if
  494.         if whichColumn = #right then
  495.           setProp(the lsStateData of oStoryteller, #BT_algorithmRight, list(newSetting))
  496.         end if
  497.         set the castNum of sprite columnSprite to getProp(columnStack, newSetting)
  498.         updateStage()
  499.       end if
  500.       set lagTime to lagTime + 40
  501.     end if
  502.   end repeat
  503.   if getState(oStoryteller, #BT_algorithmLeft) <> 5 then
  504.     exit
  505.   end if
  506.   if getState(oStoryteller, #BT_algorithmMiddle) <> 2 then
  507.     exit
  508.   end if
  509.   if getState(oStoryteller, #BT_algorithmRight) <> 8 then
  510.     exit
  511.   end if
  512.   cursorOff()
  513.   wait(60)
  514.   soundEffect(#happyBeep)
  515.   wait(10)
  516.   purgeMultiframes(#BT_algoLeft)
  517.   purgeMultiframes(#BT_algoMiddle)
  518.   purgeMultiframes(#BT_algoRight)
  519.   purgeMultiframes(#BT_algo_topBtn)
  520.   purgeMultiframes(#BT_algo_bottomBtn)
  521.   purgeMultiframes(#BT_continueBtn)
  522.   if objectp(oMemory) then
  523.     oMemory(mCompact)
  524.   end if
  525.   set the castNum of sprite 44 to 7
  526.   updateStage()
  527.   set the castNum of sprite 44 to 2351
  528.   set the visible of sprite 44 to 0
  529.   set the loc of sprite 44 to point(321, 212) + gOriginPoint
  530.   set the visible of sprite 44 to 1
  531.   updateStage()
  532.   pushVideo()
  533.   wait(#videoStop)
  534.   setState(oStoryteller, #BT_fragStatus, #allDone)
  535.   setState(oStoryteller, #endGame, 1)
  536.   updateDisplay(oPuppeteer)
  537. end
  538.